
package Bank;


import java.util.ArrayList;
import java.util.HashMap;


public class BankingTaskManager {

    public HashMap<String,BankAccount> accounts;
    private TaskManager taskManager;



    public BankingTaskManager() {
        accounts = new HashMap<>();
        taskManager = new TaskManager();
    }

    
 

    public void deposit(String accountNumber, double amount) {
        BankAccount account = accounts.get(accountNumber);
        if (account != null){
            account.deposit(amount);
            taskManager.addTask("Deposit RMB" + amount + "to Account "  + accountNumber);
        }
        
    }


    public void withdraw(String accountNumber, double amount) {
        BankAccount account = accounts.get(accountNumber);
        if (account != null){
            account.withdraw(amount);
            taskManager.addTask("withdraw RMB" + amount + "from Account "  + accountNumber);
        }
    }


    public void viewAccountDetails(String accountNumber) {
        BankAccount account = accounts.get(accountNumber);
        if (account != null){
            System.out.println(account);
        }
    }


    public void viewTasks() {
        taskManager.displayTasks();
    }
    

    public void addTask(String task) {
        taskManager.addTask(task);
    }


    public void removeTask(String priority, int index) {
        taskManager.removeTask(priority, index);
    }


    public void changePriority(String priority, int index) {
        taskManager.changePriority(priority, index);
    }


    public void promoteTask(int index) {
        taskManager.promoteTask(index);
    }


    public ArrayList<String> getHighPriorityTasks() {
        return taskManager.getHighPriorityTasks();
    }


    public ArrayList<String> getLowPriorityTasks() {
        return taskManager.getLowPriorityTasks();
    }
    
    
}
